


public class BoxMove implements MoveRule {

	@Override
	public boolean isLegalMove(Board board, Move move, Move.Direction direction) 
	{
		Move pusherMove = move.doNewMove( direction.reverse() );
		
        switch ( board.getCellType(pusherMove) ) 
        {
	        case Wall: 				return false;
	        case Player: break;
	        case PlayerOnGoalSquare: break;
	        case Box: 				return false;
	        case BoxOnGoal: 		return false;
	        case GoalSquare: break;
	        case EmptyFloor: break;
	        	
	        default: throw new IllegalArgumentException();
        }
        
        switch ( board.getCellType(move) ) 
        {
	        case Wall: 				return false;
	        case Player: break;
	        case PlayerOnGoalSquare: break;
	        case Box: 				return false;
	        case BoxOnGoal: 		return false;
	        case GoalSquare: break;
	        case EmptyFloor: break;
	        	
	        default: throw new IllegalArgumentException();
        }
        
        return true;
	}

}
